package com.k1ccc0.alumniinformationmanagement.mapper;

import com.k1ccc0.alumniinformationmanagement.pojo.Activity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ActivityMapper {

    @Select("select id,name,create_time from activity where type = '公告' order by create_time desc")
    List<Activity> selectNoticeList();

    @Select("select * from activity where id = #{id}")
    Activity selectActivity(Integer id);


    List<Activity> selectActList(String name, String publisher, String type, LocalDate begin, LocalDate end);

    void insertAct(Activity activity);

    @Select("select id,name,create_time from activity where type = '校级活动' order by create_time desc")
    List<Activity> selectSActList();



    void deleteById(List<Integer> ids);

    @Select("select id,name,create_time,image1 from activity where type = '院级活动' order by create_time desc")
    List<Activity> selectDActList();
}
